package nc.ui.med.mcm.account.ysthd;

import nc.ui.trade.bsdelegate.BusinessDelegator;
import nc.ui.trade.business.HYPubBO_Client;
import nc.vo.pub.SuperVO;

public class ClientBusinessDelegator extends BusinessDelegator {

    @Override
    public SuperVO[] queryHeadAllData(Class headClass, String strBillType, String strWhere)
        throws Exception {
        return super.queryHeadAllData(headClass, strBillType, strWhere);
    }

    @Override
    public nc.vo.pub.CircularlyAccessibleValueObject[] queryBodyAllData(Class voClass, String billType,
                                                                        String key, String strWhere)
        throws Exception {
        SuperVO vo = (SuperVO) voClass.newInstance();
        String strSql = null;
        if (vo.getParentPKFieldName() != null)
            strSql = "(" + vo.getParentPKFieldName() + "='" + key + "')";
        if (strWhere != null && strWhere.length() != 0)
            if (strSql != null)
                strSql = (strWhere) + " and " + strSql;
            else
                strSql = strWhere;
        SuperVO[] vos = (SuperVO[]) HYPubBO_Client.queryByCondition(voClass, strSql);
        return vos;
    }
}
